package com.qf.service.impl;

import com.qf.entity.Merchant;
import com.qf.mapper.MerchantMapper;
import com.qf.service.MerchantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

//商家业务逻辑层
@Service
public class MerchantServiceImpl implements MerchantService {

    @Autowired
    private MerchantMapper merchantMapper;
    /**
     * 查询所有商家
     * @return
     */
    @Override
    public List<Merchant> selAllMerchant() {
        return merchantMapper.selAllMerchant();
    }
    /**
     * 根据商家分类的id去查询对应的商家信息
     * @return
     */
    @Override
    public List<Merchant> selMerchantByMerchant_categoryId(int mc_id) {
        return merchantMapper.selMerchantByMerchant_categoryId(mc_id);
    }
    /**
     * 根据远近最快  1,2,3,4  来查询商家
     * @param vip
     * @return
     */
    @Override
    public List<Merchant> selMerchantByVip(String vip) {
        return merchantMapper.selMerchantByVip(vip);
    }
    /**
     * 根据商家名称迷糊搜索
     * @param m_name
     * @return
     */
    @Override
    public List<Merchant> selAllMerchantByName(String m_name) {
        return merchantMapper.selAllMerchantByName(m_name);
    }
}
